<?php
error_reporting(0);
$isadmin=1; 
include_once '../comm/config.php';
include_once 'include/page.class.php';
include_once '../comm/checkpostandget.php';
include_once 'check.php';
$keyword=$_GET['keyword']; 
$page = !($_GET['page'])?'1':intval($_GET['page']);
$pagesize=10;
$page2=($page-1)*$pagesize;


$link = mysql_connect($dbserver, $dbuser, $dbpass);
if (!$link) {
	die(ERR_DB);
}
else
{
	mysql_query("set names utf8");
	$sql="select * from ".$BIAOTOU."yqlj where (url like '%".$keyword."%' or webname like '%".$keyword."%') and leibie=1";
	mysql_select_db($dbname);
	$rs = mysql_query($sql);
	$total = mysql_num_rows($rs);	
	
	$sql="select * from ".$BIAOTOU."yqlj where (url like '%".$keyword."%' or webname like '%".$keyword."%') and leibie=1 order by wz asc,id desc limit $page2,$pagesize";
	$rs = mysql_query($sql);
}	
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>管理中心</title>
<link href="css/style.css" rel="stylesheet" type="text/css">
</head>

<body topmargin="5" leftmargin="0">
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td height="282" valign="top"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
        <td>
          <table cellspacing="0" width="100%" height="207" style="border:1px  solid #DCEAF7;">
            <tr>
              <td width="440" height="30" bgcolor="E9F2FB" class="bigtext"><strong>&nbsp;<img src="images/arrow.gif" width="16" height="22" align="absmiddle" /> 合作伙伴管理 [ <a href="addhzhb.php" class="link3">新增合作伙伴</a> ] </strong></td>
              <form id="form1" name="form1" method="get" action="">
              <td width="348" height="30" bgcolor="E9F2FB" class="bigtext">
                <label>网站域名或名称
                <input type="text" class="btn3" name="keyword" />
                </label>
                            <label>
                            <input type="submit" name="Submit" value="查找" />
                            </label>
             
              </td> </form>
              <td width="188" align="right" bgcolor="E9F2FB" class="bigtext">共有 <b><?php echo $total;?></b> 条记录&nbsp;&nbsp;</td>
            </tr>
            <tr>
              <td colspan="3" valign="top"><table width="100%" height="300" border="0" cellpadding="0" cellspacing="0">
                <tr>
                  <td valign="top"><table width="100%" border=1 cellpadding=0 cellspacing=0
style="border-collapse: collapse" bordercolor="#dddddd">
                  
                    <tr>
                      <td width="3%"  height="30" bgcolor="#F2F2F2" class="bigtext"><strong>&nbsp;ID</strong></td>
                      <td width="14%"  height="30" bgcolor="#F2F2F2" class="bigtext"><strong>&nbsp;网站名称</strong></td>
					  <td width="14%" bgcolor="#F2F2F2" class="bigtext"><strong>&nbsp;网站图片</strong></td>
					  <td width="29%"  bgcolor="#F2F2F2" class="bigtext"><strong>&nbsp;</strong><strong>链接地址</strong></td>
                      <td width="9%"  bgcolor="#F2F2F2" class="bigtext" align="center"><strong>显示位置</strong></td>
                      <td width="20%"  bgcolor="#F2F2F2" class="bigtext"><strong>&nbsp;添加时间</strong></td>                   
                      <td width="11%"  align="center" bgcolor="#F2F2F2" class="bigtext"><strong>&nbsp;执行操作</strong></td>
                    </tr>
					<?php
					while ($row = mysql_fetch_array($rs))
					{
						echo "<tr>";
                      	echo "<td height=30 class=bigtext>&nbsp;".$row["Id"]."</td>";
                      	echo "<td height=30 class=bigtext>&nbsp;".$row["webname"]."</td>";
						echo "<td height=30 class=bigtext>&nbsp;<img src=../upload/".$row["pic"]." width=88 height=31 /></td>";
						echo "<td class=bigtext>&nbsp;".$row["url"]."</td>";
						echo "<td class=bigtext align=\"center\">".$row["wz"]."</td>";
						echo "<td class=bigtext>&nbsp;".$row["addtime"]."</td>";
						echo "<td align=center class=bigtext><a href=chghzhb.php?id=".$row["Id"]." class=link4>修改</a> <a href=delhzhb.php?id=".$row["Id"]." class=link4>删除</a></td>";
						echo "</tr>";
					}
					?>
                  </table>
				  <div class="yahoo2" style=" margin-top:30px;"><?php 
				pageft($total,$pagesize,1,1,0,10,"hzhblist.php?keyword=".urlencode($keyword));
				echo $pagenav;?></div></td>
                </tr>
              </table></td>
            </tr>
          </table></td>
        </tr>
      
    </table></td>
  </tr>
</table>
</body>
</html>
<?php mysql_close($link);?>
